package com.xbongbong.util;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.saas.enums.business.FundTransferEnum;

import java.util.List;

/**
 * @author 吴峰
 * @date 2021/08/24 16:54
 */
public class FundTransferUtil {

    /**
     * 移除覆盖导入时候不能编辑的字段
     *
     * @param data
     * @param dbJsonObject
     */
    public static void removeUnCoverImportValue(JSONObject data, JSONObject dbJsonObject) {
        List<String> shouldRemoveFieldList = FundTransferEnum.getUnEditableAttrList();
        for (String key : dbJsonObject.keySet()) {
            if (!data.containsKey(key) || shouldRemoveFieldList.contains(key)) {
                data.put(key, dbJsonObject.get(key));
            }
        }
    }
}
